package cn.rocksolid.sport.security.service;

import cn.rocksolid.sport.common.Constant.AccessType;
import cn.rocksolid.sport.security.entity.TokenEntity;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * System access token service
 *
 * @author Axl Zhao
 * @email axl.zhao@163.com
 */
public interface TokenService extends IService<TokenEntity> {
  static final int DEFAULT_TOKEN_EXPIRE = 12 * 3600;

  /**
   * Create system access token
   */
  String create(final String accessId, final AccessType accessType, final int seconds);

  /**
   * Destroy system access token
   */
  void destroy(final String accessToken, final String accessId, final AccessType accessType);

  /**
   * Looking up access token
   */
  TokenEntity lookup(final String accessToken);
}
